package Zuoye;

import java.util.Scanner;

public class Zuoye5 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int max, min;
        max = min = 0;
        for (int i = 1; i <= 5; i++) {
            System.out.print("请输入一个整数（输入0时结束）：");
            int a = input.nextInt();
            if (i == 1) {
                min = a;
            }
            if (a > max) {
                max = a;
            }
            if (a < min) {
                min = a;
            }
        }
            System.out.println("最大值时：" + max + "\t最小值是:" + min);

            //从键盘上接收一批整数，比较并输出其中的最大值和最小值，输入数字0时结束循环

    }
}
